Ext.namespace("Swfu");
Ext.namespace("Swfu.BackMgr");

Swfu.BackMgr.MainMenuTree = Ext.extend(Ext.tree.TreePanel,
{
    id: 'mainMenu', title: '功能菜单', region: 'west', minSize: 100, maxSize: 300, collapsible: true,
    width: 170, border: true, rootVisible: false, lines: true, frame: true, autoScroll: true, root: new Ext.tree.AsyncTreeNode(
    {
        id: 'tree-root', text: "系统功能", loader: new Ext.tree.TreeLoader(
        {
            dataUrl: '/Menu.mvc/GetMenu',
            listeners:
            {
                "beforeload": function (treeloader, node) {
                    treeloader.baseParams = {
                        id: node.id, method: 'POST'
                    }
                },
                "click": function (node, event) {
                    if (node.isLeaf()) {
                        event.stopEvent();
                        ALLEvents(node)
                    }
                    else {
                        event.stopEvent();
                        node.toggle()
                    }
                }
            }
        })
    }), collapseFirst: false,
    initComponent: function () {
        Ext.apply(this, {});
        Swfu.BackMgr.MainMenuTree.superclass.initComponent.apply(this, arguments)
    },
    onRender: function () {
        Swfu.BackMgr.MainMenuTree.superclass.onRender.apply(this, arguments)
    }
});
Ext.reg('mainmenutree', Swfu.BackMgr.MainMenuTree);